import { eventTypes } from '../../../../constants/events';
import {WeaLocaleProvider} from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
const { 
  DOMLOAD, 
  FIELDVALUECHANGE,
  SETFIELDVALUE,
  GETFIELDVALUE,
  GETURLPARAMVALUE,
  ONSUBMIT,
  ONBEFORESUBMIT,
  AJAX,
  MESSAGE,
  ALERT,
  CONFIRM,
} = eventTypes;


export const getDocs = () => {
  return [
    {
      "categoryName": "basic",
      "categoryText": getLabel(526742, "基础"),
      "items": [
        {
          id: SETFIELDVALUE,
          sign: 'EdcForm.setFieldValue()',
          desc: getLabel(526743,'使用此方法设置表单字段的值'),
          example: 'EdcForm.setFieldValue(fieldidOrIndex, value)'
        },
        {
          id: GETFIELDVALUE,
          sign: 'EdcForm.getFieldValue()',
          desc: getLabel(526744,'使用此方法获取表单字段的值'),
          example: 'EdcForm.getFieldValue(fieldidOrIndex)'
        },
        {
          id: GETURLPARAMVALUE,
          sign: 'EdcForm.getUrlParamValue()',
          desc: getLabel(526745,'使用此方法获取url的参数值'),
          example: 'EdcForm.getUrlParamValue()'
        },
        {
          id: AJAX,
          sign: 'EdcForm.ajax()',
          desc: getLabel(526746,'发送ajax请求'),
        }
      ]
    },
    {
      "categoryName": "event",
      "categoryText": getLabel(526747,'事件'),
      "items": [
        {
          id: DOMLOAD,
          sign: 'domLoad',
          desc: getLabel(526748,'监听页面加载完成后执行该事件的回调'),
        },
        {
          id: FIELDVALUECHANGE,
          sign: 'fieldValueChange',
          desc: getLabel(526749,'监听表单字段的值改变后的回调'),
        },
        {
          id: ONSUBMIT,
          sign: 'onSubmit',
          desc: getLabel(526750,'监听表单提交后的回调'),
        },
        {
          id: ONBEFORESUBMIT,
          sign: 'onBeforeSubmit',
          desc: getLabel(526751,'表单提交前验证事件'),
        }
      ]
    },
    {
      "categoryName": "dialog",
      "categoryText": getLabel(526752,'弹框'),
      "items": [
        {
          id: MESSAGE,
          sign: 'EdcForm.message()',
          desc: getLabel(526753,'使用此方法可以弹出一个消息提示'),
        },
        {
          id: ALERT,
          sign: 'EdcForm.alert()',
          desc: getLabel(526754,'使用此方法可以打开一个系统提示框'),
        },
        {
          id: CONFIRM,
          sign: 'EdcForm.confirm()',
          desc: getLabel(526755,'使用此方法可以打开一个系统确认框'),
        },
      ]
    },
  ]
}






